/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package component.xml;


import java.io.File;
import java.util.Iterator;
import java.util.List;
import org.dom4j.Attribute;

import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
import org.dom4j.Node;
import org.dom4j.io.SAXReader;

/**
 *
 * @author Administrator
 */
public class xmlreadtest {
    public static void main(String args []) throws DocumentException{
        SAXReader reader=new SAXReader();
        Document document=reader.read(new File(java.util.ResourceBundle.getBundle("myproj/globalizefile").getString("3DDB.XML")));
        Element element=document.getRootElement();
        Element element1=element.element(java.util.ResourceBundle.getBundle("myproj/globalizefile").getString("工作面"));
        Iterator<Element> it=element1.elementIterator(java.util.ResourceBundle.getBundle("myproj/globalizefile").getString("钻场"));
        while(it.hasNext()){
            Iterator<Element> inIt=it.next().elementIterator(java.util.ResourceBundle.getBundle("myproj/globalizefile").getString("钻孔"));
            while(inIt.hasNext()){
                Element ein=inIt.next();
                List<Attribute> listatt=ein.attributes();
                for(int i=0;i<listatt.size();i++){
                    System.out.println(listatt.get(i).getStringValue());
                }
            }
            
        }

    }
}
